const article = require('../../model/article');

module.exports = async(req, res) => {
    let id = req.query.id
    if (id) {
        //实现修改功能
        let user = await article.findOne({ _id: id })
        res.render('admin/article-edit', { user, id, path: '/admin/article-modify?id=' + id });
        // res.send(user);
    } else {
        //实现文章发布功能
        res.render('admin/article-edit', { path: '/admin/article-edit' });
    }
}